package com.superarai.t2test.page;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.t2framework.t2.annotation.composite.GET;
import org.t2framework.t2.annotation.core.Page;
import org.t2framework.t2.navigation.Forward;
import org.t2framework.t2.spi.Navigation;

import com.superarai.t2test.logic.HelloWorldLogic;

@Page("hello")
public class HelloPage {

	// TODO LogicはpublicにしないとDIされない。→ protectedでもできるようにしたい。
	@Resource
	public HelloWorldLogic helloWorldLogic;

	@GET
	public Navigation get(HttpServletRequest request, HttpServletResponse response) {
		helloWorldLogic.printMessage();
		return Forward.to("/view/hello.jsp");
	}
}
